package cn.xi.dao;

import cn.xi.entity.PageResult;
import cn.xi.entity.Result;
import cn.xi.pojo.CheckItem;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface CheckItemDao {


    @Select("select * from t_checkitem ")
    Page<CheckItem> findPage();

    @Select("select * from t_checkitem where code like concat('%',#{queryString},'%') or name like concat('%',#{queryString},'%')")
    Page<CheckItem> findPagewhere(String queryString);

    @Insert("insert into t_checkitem (code,name,sex,age,price,type,attention,remark) values(#{code},#{name},#{sex},#{age},#{price},#{type},#{attention},#{remark})")
    void save(CheckItem checkItem);

  @Update("update t_checkitem set code=#{code},name=#{name},sex=#{sex},age=#{age},price=#{price},type=#{type},attention=#{attention},remark=#{remark} where id=#{id}")
    void update(CheckItem checkItem);

  @Select("select * from t_checkitem where id =#{id}")
  CheckItem findById(Integer id);

  @Delete("delete from t_checkitem where id = #{id}")
  void delete(Integer id);


}
